             <div class="cheerful_tuan_l_b">
                        <{foreach from=$data.tuan item=item}>
                        	<div class="cheerful_tuan_detail">
                            	 <a target="_blank" title="<{$item.title}>" href="<{link ctl='home:tuanDetail' arg0=$item.tuan_id}>"><img src="<{$pager.img}>/<{$data.home_list[$item.home_id].face_pic}>" width="180" height="125"/></a>
                                 <div class="cheerful_tuanzhuang_time">
        							<span></span>
        							<p class="jq_endtime" value='<{$item.end_time}>'>剩余时间倒计时</p>
   								 </div>
                                 <a target="_blank" title="<{$item.title}>" href="<{link ctl='home:tuanDetail' arg0=$item.tuan_id}>" class="cheerful_tuan_name"><{$item.title}></a>
                                 <div class="cheerful_tuanzhuang_join">
                                    <p>
                                        <span>立省<i>￥<{$item.jieyue}></i>元</span>
                                    </p>   
                                 </div>
                                 <div class="cl"></div>
                                 <p class="rt mr10">
                                 	<span class="cheerful_can_tuan"><i><{$item.sign_num}></i>人已经参团</span>
                                 	<a target="_blank" title="<{$item.title}>" href="<{link ctl='home:tuanDetail' arg0=$item.tuan_id}>" class="now_cantuan rt">立即参团</a>  
                                 </p>
                            </div>
                        <{/foreach}>   
                        </div>
                        <script>
    $(document).ready(function() {
        $(".cheerful_tuan_detail").mouseover(function() {
            $(this).find(".cheerful_tuanzhuang_time").addClass("currentred");
        })
        .mouseout(function() {
            $(this).find(".cheerful_tuanzhuang_time").removeClass("currentred");
        });
        var dateTime = new Date();
                var difference = dateTime.getTime() ;
                setInterval(function() {
                    $(".jq_endtime").each(function() {
                        var obj = $(this);
                        var endTime = new Date(parseInt(obj.attr('value')) * 1000);
                        var nowTime = new Date();
                        var nMS = endTime.getTime() - nowTime.getTime() + difference;
                        var myD = Math.floor(nMS / (1000 * 60 * 60 * 24));
                        var myH = Math.floor(nMS / (1000 * 60 * 60)) % 24;
                        var myM = Math.floor(nMS / (1000 * 60)) % 60;
                        var myS = Math.floor(nMS / 1000) % 60;
                        if (myD >= 0) {
                            if(myS % 3 == 0){
                                obj.parent().parent().find(".cheerful_tuanzhuang_time").addClass("currentred");
                            }else{
                                obj.parent().parent().find(".cheerful_tuanzhuang_time").removeClass("currentred");
                            }
                            var str = myD + "天" + myH + "小时" + myM + "分" + myS + "秒";
                        } else {
                            var str = "已结束！";
                        }
                        obj.html(str);
                    });
                }, 1000);
        
    });
</script>  